#include"comm.hpp"
int main()
{
    int shmid=CreatShmid();
    char* shmAddr=(char*)shmat(shmid,nullptr,0);
    //shmAddr=0;
    log.logmessage(Info,"shmaddr creat sucess");
    CreatChannel();
    int fd=OpenChannel(O_RDONLY);
    char flag;
    while(true)
    {
        int ret=read(fd,&flag,1);
        if(ret==0)
        {
            break;
        }
        else if(ret<0)
        {
            log.logmessage(Fatal,"read failuer: %s",strerror(errno));
            exit(errno);
        }        
        cout<<"processb say@: "<<shmAddr<<endl;
    }
    log.logmessage(Info,"processa quit");
    DeletShm(shmid);
    DeletChannel();
    return 0;
}